package com.fadadianqi.logistics.inventory.dao.ibatis;

import com.fadadianqi.commons.GenericDAOSuport;
import com.fadadianqi.logistics.inventory.dao.BacktrackBatchDAO;
import com.fadadianqi.logistics.inventory.model.BacktrackBatch;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Component
public class BacktrackBatchDAOImpl extends
        GenericDAOSuport<String, BacktrackBatch> implements BacktrackBatchDAO {

    @Override
    protected Class<?> getObjectClass() {
        return BacktrackBatch.class;
    }

    @Override
    protected String getTableName() {
        return "backtrack_batch";
    }

    @Override
    public List<BacktrackBatch> findBatchByBacktrackId(String backtrackId) {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("backtrackId", backtrackId);
        return super.findByPropertys(map);
    }

}
